{% extends 'user/base.html' %}
{% block user_index %}
    <div class="container">
        <div class="col-md-6 offset-3">
            <div class="text-center" style="margin-top: 60px">
                <h2>修改投票内推</h2>
            </div>
            <form action="{% url 'media_edit' media.id %}" enctype="multipart/form-data" method="post">
                {% csrf_token %}
                <div class="mb-3">
                    <label for="exampleInputEmail1" class="form-label">题目</label>
                    <input name="title" type="text" class="form-control" id="exampleInputEmail1" value="{{ media.title }}">

                </div>
                <div class="mb-3">
                    <label for="exampleInputPassword1" class="form-label">简介</label>
                    <textarea name="synopsis" id="" class="form-control" rows="3">{{ media.synopsis }}</textarea>
                </div>
                <div class="mb-5">
                    <label for="exampleInputPassword1" class="form-label">修改图片</label>
                    <br>
                    <img src="{{ MEDIA_URL }}{{ media.photo }}" width="150px" height="120px" alt="">

                    <input name="photo" required  type="file" class="form-control" style="margin-top: 10px">
                </div>
                <div class="text-end">
                    <button type="submit" class="btn btn-primary w-25">修改</button>
                </div>
            </form>
        </div>
    </div>
{% endblock %}